package com.bite.messageQueue.common;

/**
 * 表示响应，按照自定义格式展开
 */
public class Response {
    private int type;
    private int length;
    private byte[] payload;

    public Response() {
    }

    public Response(int type, int length, byte[] payload) {
        this.type = type;
        this.length = length;
        this.payload = payload;
    }

    /**
     * 获取
     * @return type
     */
    public int getType() {
        return type;
    }

    /**
     * 设置
     * @param type
     */
    public void setType(int type) {
        this.type = type;
    }

    /**
     * 获取
     * @return length
     */
    public int getLength() {
        return length;
    }

    /**
     * 设置
     * @param length
     */
    public void setLength(int length) {
        this.length = length;
    }

    /**
     * 获取
     * @return payload
     */
    public byte[] getPayload() {
        return payload;
    }

    /**
     * 设置
     * @param payload
     */
    public void setPayload(byte[] payload) {
        this.payload = payload;
    }

    public String toString() {
        return "Response{type = " + type + ", length = " + length + ", payload = " + payload + "}";
    }
}
